<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Checkbox Value</title>
</head>
<body>
<form id="myForm">
    <label>
        <input type="checkbox" name="option" value="Option 1"> Option 1
    </label>
    <label>
        <input type="checkbox" name="option" value="Option 2"> Option 2
    </label>
    <label>
        <input type="checkbox" name="option" value="Option 3"> Option 3
    </label>
    <button type="button" onclick="getCheckboxValues()">Get Values</button>
</form>

<script>
    function getCheckboxValues() {
        const checkboxes = document.querySelectorAll('input[name="option"]:checked');
        const values = Array.from(checkboxes).map(checkbox => checkbox.value);
        console.log(values);
    }
</script>
</body>
</html>
